/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.jmooc.service;

import com.jmooc.dao.CourseDao;
import com.jmooc.entity.Course;
import com.jmooc.entity.CourseModule;
import java.io.Serializable;
import java.util.List;
import javax.ejb.EJB;
import javax.ejb.Stateless;

/**
 *
 * @author Group
 */
@Stateless
public class CourseService implements Serializable {
    
    @EJB
    private CourseDao courseDao;
    
    public List<Course> getAllCourses() {
        return courseDao.getAllCourses();
    }
    
    public void create(Course course) {
        courseDao.create(course);
    }
    
    public Course getById(Long id) {
        return courseDao.getById(id);
    }

    public Course getByCourseModule(CourseModule courseModule) {
        return courseDao.getByCourseModule(courseModule);
    }
}
